-
Notifications
You must be signed in to change notification settings - Fork 5
Unit testing #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Unit testing #96
Conversation
nam20485
commented
Oct 27, 2018
- add pytest to project
- use pytest for unit testing
- add some basic unit tests
…atement from api/tests/tests.py
bhgrant8
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nam20485, started testing this today, not sure if something in my environment or not but:
on ./bin/build.sh -d I am running into the following:
Reading package lists...
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'db_development' failed to build: The command '/bin/sh -c apt-get update && apt-get install -qqy --no-install-recommends postgis postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts postgresql-9.6-postgis-scripts postgresql-9.6-pgrouting && apt-get clean' returned a non-zero code: 100
I originally was able to pull the repo and run tests but ran into 2 failing ones:
============================================ test session starts =============================================
platform linux -- Python 3.6.5, pytest-4.0.1, py-1.7.0, pluggy-0.8.0
Django settings: dead_songs.settings (from ini file)
rootdir: /code, inifile: pytest.ini
plugins: xdist-1.24.1, forked-0.2, django-3.4.4
gw0 [13] / gw1 [13] / gw2 [13] / gw3 [13]
scheduling tests via LoadScheduling
..........F.F [100%]
================================================== FAILURES ==================================================
_________________________________ APIEndpointsTestCase.test_detail_responses _________________________________
[gw2] linux -- Python 3.6.5 /usr/local/bin/python
self = <api.tests.tests.APIEndpointsTestCase testMethod=test_detail_responses>
def test_detail_responses(self):
for endpoint in self.datasets:
> response = self.client.get('/api/'+endpoint+'/1/')
api/tests/tests.py:59:
_ _ _ _ _ _ _ _ _ _ _ _
and:
__________________________________ APIEndpointsTestCase.test_list_responses __________________________________
[gw0] linux -- Python 3.6.5 /usr/local/bin/python
self = <api.tests.tests.APIEndpointsTestCase testMethod=test_list_responses>
def test_list_responses(self):
for endpoint in self.datasets:
> response = self.client.get('/api/'+endpoint+'/')
api/tests/tests.py:55:
_ _ _ _ _ _ _ _ _ _ _ _ _
Then i ran a docker system prune as I have nothing else in docker running right now, figured I'd nuke the system and confirm any issues.
Began the first 2 steps of the build for the sample:
First cd into the root directory of your clone of the repo and run the command cp env.sample .env
Build the development containers using the command: ./bin/build.sh -d
This is where I ran into above error.
Here is the full log:
UA-C02T8D1VGTFM:backend-examplar-2018 brian.grant$ ./bin/build.sh -d
Building db_development
Step 1/6 : FROM postgres:9.6
---> 12fd61c0e7e1
Step 2/6 : LABEL maintainer="M. Edward (Ed) Borasky <znmeb@znmeb.net>"
---> Running in 283c0ee9f727
Removing intermediate container 283c0ee9f727
---> c6b3412465c0
Step 3/6 : RUN apt-get update && apt-get install -qqy --no-install-recommends postgis postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts postgresql-9.6-postgis-scripts postgresql-9.6-pgrouting && apt-get clean
---> Running in 387f68215f48
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2,434 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [460 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [5,152 B]
Get:8 http://apt.postgresql.org/pub/repos/apt stretch-pgdg InRelease [46.3 kB]
Get:9 http://deb.debian.org/debian stretch/main amd64 Packages [7,089 kB]
Get:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/9.6 amd64 Packages [1,850 B]
Get:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages [164 kB]
Fetched 8,072 kB in 2s (2,880 kB/s)
Reading package lists...
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'db_development' failed to build: The command '/bin/sh -c apt-get update && apt-get install -qqy --no-install-recommends postgis postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts postgresql-9.6-postgis-scripts postgresql-9.6-pgrouting && apt-get clean' returned a non-zero code: 100
So appears to be on the development db startup. maybe something has changed with a package there preventing a new build?
…ge install errors
…nt with postgresql-9.6-postgis-2.4-scripts
|
@bhgrant8 thanks for the debug info. The issue you encountered has been resolved- there was a redundant package specified for
Please update your working copy and try again. (Adding @znmeb since he helped create the postgres/postgis installation steps. We may need to check this on other repos that install postgis) |